﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;


namespace JumpFleetGameLib.Objects.Weapons
{
    public abstract class BaseWeapons
    {
        protected Vector2 m_vecPosition;

        protected Vector2 m_vecVelocity;

        protected Vector2 m_vecDirection;

        protected Rectangle m_recBounds;

        protected Texture2D m_shipTexture;

        protected string m_szName;

        protected int m_nAmmoCount;

        protected int m_nBulletDamage;

        protected int m_nClipSize;

        protected int m_nNumberOfClips;

        protected float m_fRateOfFire;

        protected float m_fReloadSpeed;

        protected bool m_bisHasAmmo;

        protected bool m_bisHasClips;

        public BaseWeapons()
        {

        }

        public BaseWeapons(int ammo, int power, string name)
        {

        }

        // Weapon Actions
        public virtual void Reload()
        {
        }

        public virtual void Fire()
        {
        }

        public bool IsOutOfAmmo()
        {
            if (m_bisHasAmmo)
            {
                Console.WriteLine("Is Out Of Ammo");
                return true;
            }
            return false;
        }

        // System stuff
        public virtual void Update(float dt)
        {
            // Update the guns and bullet position when fired,
            // also check if we are out of ammo

            if (IsOutOfAmmo())
            {
                Console.WriteLine("Base Class Reload");
                Reload();
            }
            Console.WriteLine("Update Base Bullet Position");
        }

        public virtual void Draw(/*/spritebatch*/)
        {
            // renderbullet
            Console.WriteLine("Draw Bullet");

            // render gun
            Console.WriteLine("Draw Gun");

        }
    }
}
